﻿using System;
using CodeCounsel.SharePoint.RibbonDesigner.Model;

namespace CodeCounsel.SharePoint.RibbonDesigner.ViewModel
{
    public static class ControlViewModelFactory
    {
        public static BaseViewModel CreateControlModel(
            Control control, DisplayMode displayMode)
        {
            BaseViewModel model = null;
            if (control is Button)
            {
                model = new ButtonViewModel((Button)control, displayMode);
            }
            else if (control != null)
            {
                model = new UnknownControlViewModel((Control)control, displayMode);
            }
            return model;
        }
    }
}
